# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python2-coding
pkgname=('python2-coding' 'python-coding')
_pkgname=coding
pkgver=0.3
pkgrel=10
pkgdesc='An answer to the question of python enums.'
arch=('any')
url='https://pypi.python.org/pypi/coding/'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://pypi.python.org/packages/85/a0/9a49f417340d6ba7c0957c865f6f11cdce9c3509cc030ef3fe166ed4bd9c/$_pkgname-$pkgver.tar.bz2")
sha512sums=('2cb37d5797f792a10469074bd2cbaafb411fcfbc9d0c574ac0bcac0c8705324df24c256ab2cdca699967267aca0894b21d274bae335d49840e049ef6aab8db22')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-coding() {
  depends=('python2' 'python2-nose')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-coding() {
  depends=('python' 'python-nose')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

